<template>
  <div class="tab_cut">
     <span :class="{active:cutIndex==0}" @click="cut(0)">商品介绍</span>
     <span :class="{active:cutIndex==1}" @click="cut(1)">商品评价</span>
  </div>
</template>

<script>
import { ref, reactive, toRefs } from "vue";
export default {
  setup(props,{emit}) { // 第一个参数是用来获取 父传子的数据
//   console.log(ctx);
   const cutIndex = ref(0);
   const cut = (i) => {
     cutIndex.value = i
     emit('cut',i);
   }
   return{
    cutIndex,
     cut
   }
  },
};
</script>
<style lang="scss" scoped>
.tab_cut{
  line-height: 44px;
  background: #fff;
  font-size: 16px;
  margin-top: 10px;
   span{
     display: inline-block;
     width: 50%;
     text-align: center;
   }
   .active{
     border-bottom: 2px solid red;
   }
}
</style>